import * as types from './mutation-types';

/**
 * 用户信息
 */
export function setUserInfo({ commit }, key) {
    return new Promise((resolve, reject) => {
        uni.setStorage({
            key: 'bht_userInfo',
            data: key,
            success: () => {
                commit(types.SET_USER_INFO, key);
                resolve(key);
            },
        });
    }).catch(err => {
        reject(err);
    });
}
// 矿机详情
export function setMachineDetails({ commit }, key) {
    commit(types.SET_MACHINE_DETAILS, key);
}
// 活动详情
export function steActivityDetails({ commit }, key) {
    commit(types.SET_ACTIVITY_DETAILS, key);
}
// 直推活动详情
export function steActivityDirectDetails({ commit }, key) {
    commit(types.SET_ACTIVITY_DIRECT_DETAILS, key);
}
// 买入
export function setBuyInfo({ commit }, key) {
    commit(types.SET_BUY_INFO, key);
}
// 卖出
export function setSellInfo({ commit }, key) {
    commit(types.SET_SELL_INFO, key);
}
// 挂买单详情
export function steRecordBuyDetails({ commit }, key) {
    commit(types.SET_RECORD_BUY_DETAILS, key);
}
// 挂卖单详情
export function steRecordSeelDetails({ commit }, key) {
    commit(types.SET_RECORD_SEEL_DETAILS, key);
}
export function logOut({ commit }, key) {
    commit(types.LOG_OUT, key);
}

/**
 * 	版本检查
 */
export function setUpdate({ commit }, key) {
    commit(types.SET_UPDATE, key);
}
